package com.ruoyi.project.mydy.movieprofit.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.movieprofit.mapper.DlMovieProfitMapper;
import com.ruoyi.project.mydy.movieprofit.domain.DlMovieProfit;
import com.ruoyi.project.mydy.movieprofit.service.IDlMovieProfitService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 电影票房Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlMovieProfitServiceImpl implements IDlMovieProfitService 
{
    @Autowired
    private DlMovieProfitMapper dlMovieProfitMapper;

    /**
     * 查询电影票房
     * 
     * @param id 电影票房主键
     * @return 电影票房
     */
    @Override
    public DlMovieProfit selectDlMovieProfitById(Long id)
    {
        return dlMovieProfitMapper.selectDlMovieProfitById(id);
    }

    /**
     * 查询电影票房列表
     * 
     * @param dlMovieProfit 电影票房
     * @return 电影票房
     */
    @Override
    public List<DlMovieProfit> selectDlMovieProfitList(DlMovieProfit dlMovieProfit)
    {
        return dlMovieProfitMapper.selectDlMovieProfitList(dlMovieProfit);
    }

    /**
     * 新增电影票房
     * 
     * @param dlMovieProfit 电影票房
     * @return 结果
     */
    @Override
    public int insertDlMovieProfit(DlMovieProfit dlMovieProfit)
    {
        dlMovieProfit.setCreateTime(DateUtils.getNowDate());
        return dlMovieProfitMapper.insertDlMovieProfit(dlMovieProfit);
    }

    /**
     * 修改电影票房
     * 
     * @param dlMovieProfit 电影票房
     * @return 结果
     */
    @Override
    public int updateDlMovieProfit(DlMovieProfit dlMovieProfit)
    {
        return dlMovieProfitMapper.updateDlMovieProfit(dlMovieProfit);
    }

    /**
     * 批量删除电影票房
     * 
     * @param ids 需要删除的电影票房主键
     * @return 结果
     */
    @Override
    public int deleteDlMovieProfitByIds(String ids)
    {
        return dlMovieProfitMapper.deleteDlMovieProfitByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除电影票房信息
     * 
     * @param id 电影票房主键
     * @return 结果
     */
    @Override
    public int deleteDlMovieProfitById(Long id)
    {
        return dlMovieProfitMapper.deleteDlMovieProfitById(id);
    }
}
